/*
 *  Copyright (c) 2009, Hugo Augusto Alves
 *  All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *      * Redistributions of source code must retain the above copyright
 *        notice, this list of conditions and the following disclaimer.
 *      * Redistributions in binary form must reproduce the above copyright
 *        notice, this list of conditions and the following disclaimer in the
 *        documentation and/or other materials provided with the distribution.
 *      * Neither the appName of the Hugo Augusto Alves nor the
 *        names of its contributors may be used to endorse or promote products
 *        derived from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 *  DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
 *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * MainWindow.java
 *
 * Created on 31/10/2009, 15:24:28
 */
package org.wiscriptor.gui;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import javax.swing.JFileChooser;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JToggleButton;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import org.jvnet.substance.SubstanceLegacyDefaultLookAndFeel;
import org.jvnet.substance.skin.SubstanceAutumnLookAndFeel;
import org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel;
import org.jvnet.substance.skin.SubstanceBusinessBlueSteelLookAndFeel;
import org.jvnet.substance.skin.SubstanceBusinessLookAndFeel;
import org.jvnet.substance.skin.SubstanceChallengerDeepLookAndFeel;
import org.jvnet.substance.skin.SubstanceCremeCoffeeLookAndFeel;
import org.jvnet.substance.skin.SubstanceCremeLookAndFeel;
import org.jvnet.substance.skin.SubstanceDustCoffeeLookAndFeel;
import org.jvnet.substance.skin.SubstanceDustLookAndFeel;
import org.jvnet.substance.skin.SubstanceEmeraldDuskLookAndFeel;
import org.jvnet.substance.skin.SubstanceMagmaLookAndFeel;
import org.jvnet.substance.skin.SubstanceMistAquaLookAndFeel;
import org.jvnet.substance.skin.SubstanceMistSilverLookAndFeel;
import org.jvnet.substance.skin.SubstanceModerateLookAndFeel;
import org.jvnet.substance.skin.SubstanceNebulaBrickWallLookAndFeel;
import org.jvnet.substance.skin.SubstanceNebulaLookAndFeel;
import org.jvnet.substance.skin.SubstanceOfficeBlue2007LookAndFeel;
import org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel;
import org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel;
import org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel;
import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;
import org.jvnet.substance.skin.SubstanceTwilightLookAndFeel;
import org.wiscriptor.core.WisProperties;
import org.wiscriptor.core.WiscriptorController;
import org.wiscriptor.lmldocument.OldLmlDocument;
import org.wiscriptor.internalization.I18N;
import org.wiscriptor.internalization.Language;
import org.wiscriptor.utils.Utils;
import org.wiscriptor.wiki.Category;
import org.wiscriptor.wiki.Page;

/**
 *
 * @author Hugo
 */
public class MainWindow extends javax.swing.JFrame {

    private static enum mode {

        edit, visualize
    }

    public static enum laf {

        autumn, business, bBlack, bBlue, challenger, cremme, cCoffee, dust, dCoffee, emerald, legacy, magma, mAqua, mSilver, moderate,
        nebula, nBrick, oBlue, oSilver, raven, rGlass, rGraphite, twilight, system
    }
    // controller
    private WiscriptorController wiscontroller;
    // extra objects
    private JFileChooser fileChooser;
    private I18N i18n = I18N.getInstance();
    private ArrayList<Language> langs;
    private DefaultMutableTreeNode treeRoot;
    private ArrayList<String> catList;

    public MainWindow(WiscriptorController controller) {
        this.wiscontroller = controller;
        setLAF(laf.business);
        init();
    }

    public void setLAF(String l) {
        MainWindow.laf look = laf.system;
        if (l.equals("Autumn")) {
            look = laf.autumn;
        } else if (l.equals("Business")) {
            look = laf.business;
        } else if (l.equals("Business Black")) {
            look = laf.bBlack;
        } else if (l.equals("Business Blue")) {
            look = laf.bBlue;
        } else if (l.equals("Challenger")) {
            look = laf.challenger;
        } else if (l.equals("Cremme")) {
            look = laf.cremme;
        } else if (l.equals("Cremme Coffe")) {
            look = laf.cCoffee;
        } else if (l.equals("Dust")) {
            look = laf.dust;
        } else if (l.equals("Dust Coffe")) {
            look = laf.dCoffee;
        } else if (l.equals("Emerald")) {
            look = laf.emerald;
        } else if (l.equals("Legacy")) {
            look = laf.legacy;
        } else if (l.equals("Magma")) {
            look = laf.magma;
        } else if (l.equals("Mist Aqua")) {
            look = laf.mAqua;
        } else if (l.equals("Mist Silver")) {
            look = laf.mSilver;
        } else if (l.equals("Moderate")) {
            look = laf.moderate;
        } else if (l.equals("Nebula")) {
            look = laf.nebula;
        } else if (l.equals("Nebula Brick")) {
            look = laf.nBrick;
        } else if (l.equals("Office Blue")) {
            look = laf.oBlue;
        } else if (l.equals("Office Silver")) {
            look = laf.oSilver;
        } else if (l.equals("Raven")) {
            look = laf.raven;
        } else if (l.equals("Raven Glass")) {
            look = laf.rGlass;
        } else if (l.equals("Raven Graphite")) {
            look = laf.rGraphite;
        } else if (l.equals("Twilight")) {
            look = laf.twilight;
        } else {
            look = laf.system;
        }
        setLAF(look);
    }

    private void setLAF(laf l) {
        LookAndFeel look = null;
        try {
            switch (l) {
                case autumn:
                    look = new SubstanceAutumnLookAndFeel();
                    break;
                case business:
                    look = new SubstanceBusinessLookAndFeel();
                    break;
                case bBlack:
                    look = new SubstanceBusinessBlackSteelLookAndFeel();
                    break;
                case bBlue:
                    look = new SubstanceBusinessBlueSteelLookAndFeel();
                    break;
                case challenger:
                    look = new SubstanceChallengerDeepLookAndFeel();
                    break;
                case cremme:
                    look = new SubstanceCremeLookAndFeel();
                    break;
                case cCoffee:
                    look = new SubstanceCremeCoffeeLookAndFeel();
                    break;
                case dust:
                    look = new SubstanceDustLookAndFeel();
                    break;
                case dCoffee:
                    look = new SubstanceDustCoffeeLookAndFeel();
                    break;
                case emerald:
                    look = new SubstanceEmeraldDuskLookAndFeel();
                    break;
                case legacy:
                    look = new SubstanceLegacyDefaultLookAndFeel();
                    break;
                case magma:
                    look = new SubstanceMagmaLookAndFeel();
                    break;
                case mAqua:
                    look = new SubstanceMistAquaLookAndFeel();
                    break;
                case mSilver:
                    look = new SubstanceMistSilverLookAndFeel();
                    break;
                case moderate:
                    look = new SubstanceModerateLookAndFeel();
                    break;
                case nebula:
                    look = new SubstanceNebulaLookAndFeel();
                    break;
                case nBrick:
                    look = new SubstanceNebulaBrickWallLookAndFeel();
                    break;
                case oBlue:
                    look = new SubstanceOfficeBlue2007LookAndFeel();
                    break;
                case oSilver:
                    look = new SubstanceOfficeSilver2007LookAndFeel();
                    break;
                case raven:
                    look = new SubstanceRavenLookAndFeel();
                    break;
                case rGraphite:
                    look = new SubstanceRavenGraphiteLookAndFeel();
                    break;
                case rGlass:
                    look = new SubstanceRavenGraphiteGlassLookAndFeel();
                    break;
                case twilight:
                    look = new SubstanceTwilightLookAndFeel();
                    break;
                default:
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                    return;
            }

            UIManager.setLookAndFeel(look);
            SwingUtilities.updateComponentTreeUI(this);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void init() {
        initComponents();
        fileChooser = new JFileChooser();



        //((AbstractDocument) editorPane.getDocument()).setDocumentFilter(new WDocumentFilter());
        // TODO: pegar das configuracoes
        editorPane.setBackground(Color.lightGray);
        editorPane.setFont(new Font("Consolas", Font.PLAIN, 12));


//        loadToolBar(mode.visualize);
        createPage();


        langs = I18N.getInstance().getAvailableLanguages();
        for (Language l : langs) {
            langsComboBox.addItem(l.getName());
        }

        omniTextField.add(omniPopupMenu);
        catTree.setModel(null);

        setAppName();
    }

    public void setCategoriesTree() {
        treeRoot = new DefaultMutableTreeNode(wiscontroller.getCurrentWikiName());
        setTreeNode(treeRoot, Category.root);
        DefaultTreeModel dtm = new DefaultTreeModel(treeRoot);
        catTree.setModel(dtm);
    }

    private void setTreeNode(DefaultMutableTreeNode parent, String category) {
        ArrayList<String> list = wiscontroller.getCategoriesPages(category);
        for (String s : list) {
            DefaultMutableTreeNode dmtn = new DefaultMutableTreeNode(s);
            parent.add(dmtn);
            setTreeNode(dmtn, s);
        }
    }

    public void setAppName() {

        String name = wiscontroller.getCurrentWikiName();
        if (!name.equals("")) {
            this.setTitle(name + " - " + WisProperties.appName + " " + WisProperties.appVersion);
        } else {
            this.setTitle(WisProperties.appName + " " + WisProperties.appVersion);
        }

    }

    public void reloadLabels() {
        contentTabbedPane.setTitleAt(0, i18n.getValueForKey(I18N.key.tabsViewer));
        contentTabbedPane.setTitleAt(1, i18n.getValueForKey(I18N.key.tabsEditor));

        generalLAFPane.setBorder(javax.swing.BorderFactory.createTitledBorder(I18N.getInstance().getValueForKey(I18N.key.settingslafTitle)));
        generalLangsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(I18N.getInstance().getValueForKey(I18N.key.settingslangTitle)));
        tabbedPane.setTitleAt(0, I18N.getInstance().getValueForKey(I18N.key.settingsTab01));
        tabbedPane.setTitleAt(1, I18N.getInstance().getValueForKey(I18N.key.settingsTab02));
        tabbedPane.setTitleAt(2, I18N.getInstance().getValueForKey(I18N.key.settingsTab03));
    }

    // TODO: estudar o livro de swing para criar actions de open, save, copy, cut, paste, delete, undo e redo
    private int showSaveDialog() {
        Object[] options = {
            i18n.getValueForKey(I18N.key.stringYes),
            i18n.getValueForKey(I18N.key.stringNo),
            i18n.getValueForKey(I18N.key.stringCancel)
        };
        return JOptionPane.showOptionDialog(this,
                i18n.getValueForKey(I18N.key.stringsavefileMessage),
                i18n.getValueForKey(I18N.key.stringsavefileTitle),
                JOptionPane.YES_NO_CANCEL_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null,
                options,
                options[0]);
    }

    private File showOpenDialog() {
        int res = fileChooser.showOpenDialog(null);
        if (res == JFileChooser.APPROVE_OPTION) {
            return fileChooser.getSelectedFile();
        }
        return null;
    }

    private void createPage() {
        viewerPane.setText(wiscontroller.getPageContent());
    }

    private void showPage(String name) {
        if (wiscontroller.openPage(name) == Utils.Status.SUCCESS) {
            Page p = wiscontroller.getPage();
            nameTextField.setText(p.getName());
            editorPane.setText(p.getText());
            contentTabbedPane.setSelectedComponent(editorPanel);
            omniTextField.setText(wiscontroller.getCategory(name));
            // TODO: omnibox and version
        }

    }

    private void loadToolBar(mode m) {
//        mainToolBar.removeAll();
//        switch (m) {
//            case edit:
//                for (AbstractButton b : editButtons) {
//                    mainToolBar.add(b);
//                }
//                break;
//            case visualize:
//                for (AbstractButton b : visualizeButtons) {
//                    mainToolBar.add(b);
//                }
//                break;
//        }
//        mainToolBar.repaint();
    }

    /*
    private void changeView(mode m) {
    loadToolBar(m);
    int index;
    int fileId;
    String text;
    switch (m) {
    case edit:
    index = Utils.indexOfDocView(tabbedPaneFiles.getSelectedIndex(), views);
    if (index == Utils.ERROR) {
    System.err.println("Error on changeView:edit");
    return;
    }
    fileId = views.get(index).getFileId();
    text = controller.getPageRawText(fileId);
    editorPane.setText(text);
    splitPane.setRightComponent(editorPane);
    break;
    case visualize:
    index = Utils.indexOfDocView(tabbedPaneFiles.getSelectedIndex(), views);
    if (index == Utils.ERROR) {
    System.err.println("Error on changeView:visualize");
    return;
    }
    fileId = views.get(index).getFileId();
    int tabId = views.get(index).getTabId();
    text = controller.editPage(fileId, editorPane.getText());
    ((JEditorPane) tabbedPaneFiles.getComponentAt(tabId)).setText(text);
    splitPane.setRightComponent(tabbedPaneFiles);
    break;
    }
    }
     * */
    private void editAction(String text, WiscriptorController.editAction e) {
        int start = editorPane.getSelectionStart();
        int end = editorPane.getSelectionEnd();
        editorPane.setText(wiscontroller.editText(editorPane.getText(), text, start, end, e));
    }

    private void formatAction(OldLmlDocument.marks m, JToggleButton btn) {
        int start = editorPane.getSelectionStart();
        int end = editorPane.getSelectionEnd();
        editorPane.setText(wiscontroller.formatText(editorPane.getText(), m, start, end));
        if (start != end) {
            btn.setSelected(false);
        }
        int caretPos = (start == end) ? end + 1 : end + 2;
        editorPane.setCaretPosition(caretPos);
    }

    public String getPageTitle() {
        return nameTextField.getText();
    }

    public String getPageText() {
        return editorPane.getText();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this not. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        omniPopupMenu = new javax.swing.JPopupMenu();
        mainPanel = new javax.swing.JPanel();
        contentPanel = new javax.swing.JPanel();
        splitPane = new javax.swing.JSplitPane();
        leftPanel = new javax.swing.JPanel();
        leftTabbedPane = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        catTree = new javax.swing.JTree();
        jPanel2 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        contentTabbedPane = new javax.swing.JTabbedPane();
        viewerPanel = new javax.swing.JPanel();
        viewerScrollPane = new javax.swing.JScrollPane();
        viewerPane = new javax.swing.JEditorPane();
        editorPanel = new javax.swing.JPanel();
        editorToolBar = new javax.swing.JToolBar();
        btnCut = new javax.swing.JButton();
        btnCopy = new javax.swing.JButton();
        btnPaste = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        btnUndo = new javax.swing.JButton();
        btnRedo = new javax.swing.JButton();
        btnBold = new javax.swing.JToggleButton();
        btnItalic = new javax.swing.JToggleButton();
        btnUnderline = new javax.swing.JToggleButton();
        btnStrike = new javax.swing.JToggleButton();
        btnSuperscript = new javax.swing.JToggleButton();
        btnSubscript = new javax.swing.JToggleButton();
        btnPreformatted = new javax.swing.JToggleButton();
        btnNotformatted = new javax.swing.JToggleButton();
        btnComment = new javax.swing.JToggleButton();
        editorScrollPane = new javax.swing.JScrollPane();
        editorPane = new javax.swing.JTextPane();
        nameTextField = new javax.swing.JTextField();
        btnDiscard = new javax.swing.JButton();
        btnSave = new javax.swing.JButton();
        btnPreview = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        omniTextField = new javax.swing.JTextField();
        settingsPanel = new javax.swing.JPanel();
        tabbedPane = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        mainPanel1 = new javax.swing.JPanel();
        generalLAFPane = new javax.swing.JPanel();
        lafComboBox = new javax.swing.JComboBox();
        lafBtn = new javax.swing.JButton();
        generalLangsPanel = new javax.swing.JPanel();
        langsComboBox = new javax.swing.JComboBox();
        langsBtn = new javax.swing.JButton();
        toolBar = new javax.swing.JToolBar();
        btnNewWiki = new javax.swing.JButton();
        btnOpenWiki = new javax.swing.JButton();
        btnNewPage = new javax.swing.JButton();
        btnAllPages = new javax.swing.JButton();
        btnRandomPage = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        omniPopupMenu.setName("omniPopupMenu"); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setExtendedState(javax.swing.JFrame.MAXIMIZED_BOTH);
        setMinimumSize(new java.awt.Dimension(800, 600));

        mainPanel.setName("mainPanel"); // NOI18N

        contentPanel.setName("contentPanel"); // NOI18N

        splitPane.setDividerLocation(200);
        splitPane.setDividerSize(3);
        splitPane.setMinimumSize(new java.awt.Dimension(0, 0));
        splitPane.setName("splitPane"); // NOI18N

        leftPanel.setName("leftPanel"); // NOI18N
        leftPanel.setPreferredSize(new java.awt.Dimension(50, 445));

        leftTabbedPane.setMinimumSize(new java.awt.Dimension(200, 128));
        leftTabbedPane.setName("leftTabbedPane"); // NOI18N

        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        catTree.setName("catTree"); // NOI18N
        catTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                catTreeValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(catTree);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 195, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
        );

        leftTabbedPane.addTab("", new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/treeCategories.png")), jPanel3); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 195, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 454, Short.MAX_VALUE)
        );

        leftTabbedPane.addTab("", new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/treeTags.png")), jPanel2); // NOI18N

        jPanel6.setName("jPanel6"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 195, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 454, Short.MAX_VALUE)
        );

        leftTabbedPane.addTab("", new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/treeCalendar.png")), jPanel6); // NOI18N

        javax.swing.GroupLayout leftPanelLayout = new javax.swing.GroupLayout(leftPanel);
        leftPanel.setLayout(leftPanelLayout);
        leftPanelLayout.setHorizontalGroup(
            leftPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(leftTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
        );
        leftPanelLayout.setVerticalGroup(
            leftPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(leftTabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
        );

        splitPane.setLeftComponent(leftPanel);

        contentTabbedPane.setMinimumSize(new java.awt.Dimension(0, 0));
        contentTabbedPane.setName("contentTabbedPane"); // NOI18N
        contentTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                contentTabbedPaneStateChanged(evt);
            }
        });

        viewerPanel.setName("viewerPanel"); // NOI18N

        viewerScrollPane.setName("viewerScrollPane"); // NOI18N

        viewerPane.setContentType("text/html");
        viewerPane.setEditable(false);
        viewerPane.setText("<html>\r\n  <head>\r\n\r\n  </head>\r\n  <body>\r\n    <p style=\"margin-top: 0\">\r\n      \r<a href=\"www.google.com\">link</a>\n    </p>\r\n  </body>\r\n</html>\r\n");
        viewerPane.setName("viewerPane"); // NOI18N
        viewerPane.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
            public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
                viewerPaneHyperlinkUpdate(evt);
            }
        });
        viewerScrollPane.setViewportView(viewerPane);

        javax.swing.GroupLayout viewerPanelLayout = new javax.swing.GroupLayout(viewerPanel);
        viewerPanel.setLayout(viewerPanelLayout);
        viewerPanelLayout.setHorizontalGroup(
            viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(viewerScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
        );
        viewerPanelLayout.setVerticalGroup(
            viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(viewerScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
        );

        contentTabbedPane.addTab(i18n.getValueForKey(I18N.key.tabsViewer), new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/viewer.png")), viewerPanel); // NOI18N

        editorPanel.setName("editorPanel"); // NOI18N

        editorToolBar.setFloatable(false);
        editorToolBar.setRollover(true);
        editorToolBar.setMinimumSize(new java.awt.Dimension(0, 0));
        editorToolBar.setName("editorToolBar"); // NOI18N

        btnCut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textCut.png"))); // NOI18N
        btnCut.setFocusable(false);
        btnCut.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCut.setName("btnCut"); // NOI18N
        btnCut.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCutActionPerformed(evt);
            }
        });
        editorToolBar.add(btnCut);

        btnCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textCopy.png"))); // NOI18N
        btnCopy.setFocusable(false);
        btnCopy.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCopy.setName("btnCopy"); // NOI18N
        btnCopy.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCopy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCopyActionPerformed(evt);
            }
        });
        editorToolBar.add(btnCopy);

        btnPaste.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textPaste.png"))); // NOI18N
        btnPaste.setFocusable(false);
        btnPaste.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnPaste.setName("btnPaste"); // NOI18N
        btnPaste.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnPaste.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPasteActionPerformed(evt);
            }
        });
        editorToolBar.add(btnPaste);

        btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textDelete.png"))); // NOI18N
        btnDelete.setFocusable(false);
        btnDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnDelete.setName("btnDelete"); // NOI18N
        btnDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });
        editorToolBar.add(btnDelete);

        btnUndo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textUndo.png"))); // NOI18N
        btnUndo.setFocusable(false);
        btnUndo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnUndo.setName("btnUndo"); // NOI18N
        btnUndo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        editorToolBar.add(btnUndo);

        btnRedo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textRedo.png"))); // NOI18N
        btnRedo.setFocusable(false);
        btnRedo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnRedo.setName("btnRedo"); // NOI18N
        btnRedo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        editorToolBar.add(btnRedo);

        btnBold.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textBold.png"))); // NOI18N
        btnBold.setFocusable(false);
        btnBold.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnBold.setMaximumSize(new java.awt.Dimension(18, 23));
        btnBold.setMinimumSize(new java.awt.Dimension(18, 23));
        btnBold.setName("btnBold"); // NOI18N
        btnBold.setPreferredSize(new java.awt.Dimension(18, 23));
        btnBold.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnBold.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBoldActionPerformed(evt);
            }
        });
        editorToolBar.add(btnBold);

        btnItalic.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textItalic.png"))); // NOI18N
        btnItalic.setFocusable(false);
        btnItalic.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnItalic.setMaximumSize(new java.awt.Dimension(18, 23));
        btnItalic.setMinimumSize(new java.awt.Dimension(18, 23));
        btnItalic.setName("btnItalic"); // NOI18N
        btnItalic.setPreferredSize(new java.awt.Dimension(18, 23));
        btnItalic.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnItalic.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnItalicActionPerformed(evt);
            }
        });
        editorToolBar.add(btnItalic);

        btnUnderline.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textUnderline.png"))); // NOI18N
        btnUnderline.setFocusable(false);
        btnUnderline.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnUnderline.setMaximumSize(new java.awt.Dimension(18, 23));
        btnUnderline.setMinimumSize(new java.awt.Dimension(18, 23));
        btnUnderline.setName("btnUnderline"); // NOI18N
        btnUnderline.setPreferredSize(new java.awt.Dimension(18, 23));
        btnUnderline.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnUnderline.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUnderlineActionPerformed(evt);
            }
        });
        editorToolBar.add(btnUnderline);

        btnStrike.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textStrikethrough.png"))); // NOI18N
        btnStrike.setFocusable(false);
        btnStrike.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnStrike.setMaximumSize(new java.awt.Dimension(18, 23));
        btnStrike.setMinimumSize(new java.awt.Dimension(18, 23));
        btnStrike.setName("btnStrike"); // NOI18N
        btnStrike.setPreferredSize(new java.awt.Dimension(18, 23));
        btnStrike.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnStrike.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStrikeActionPerformed(evt);
            }
        });
        editorToolBar.add(btnStrike);

        btnSuperscript.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textSuperscript.png"))); // NOI18N
        btnSuperscript.setFocusable(false);
        btnSuperscript.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSuperscript.setMaximumSize(new java.awt.Dimension(18, 23));
        btnSuperscript.setMinimumSize(new java.awt.Dimension(18, 23));
        btnSuperscript.setName("btnSuperscript"); // NOI18N
        btnSuperscript.setPreferredSize(new java.awt.Dimension(18, 23));
        btnSuperscript.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSuperscript.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSuperscriptActionPerformed(evt);
            }
        });
        editorToolBar.add(btnSuperscript);

        btnSubscript.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/textSubscript.png"))); // NOI18N
        btnSubscript.setFocusable(false);
        btnSubscript.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSubscript.setMaximumSize(new java.awt.Dimension(18, 23));
        btnSubscript.setMinimumSize(new java.awt.Dimension(18, 23));
        btnSubscript.setName("btnSubscript"); // NOI18N
        btnSubscript.setPreferredSize(new java.awt.Dimension(18, 23));
        btnSubscript.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSubscript.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubscriptActionPerformed(evt);
            }
        });
        editorToolBar.add(btnSubscript);

        btnPreformatted.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-Preformatted.png"))); // NOI18N
        btnPreformatted.setFocusable(false);
        btnPreformatted.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnPreformatted.setMaximumSize(new java.awt.Dimension(18, 23));
        btnPreformatted.setMinimumSize(new java.awt.Dimension(18, 23));
        btnPreformatted.setName("btnPreformatted"); // NOI18N
        btnPreformatted.setPreferredSize(new java.awt.Dimension(18, 23));
        btnPreformatted.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        editorToolBar.add(btnPreformatted);

        btnNotformatted.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-Notformatted.png"))); // NOI18N
        btnNotformatted.setFocusable(false);
        btnNotformatted.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNotformatted.setMaximumSize(new java.awt.Dimension(18, 23));
        btnNotformatted.setMinimumSize(new java.awt.Dimension(18, 23));
        btnNotformatted.setName("btnNotformatted"); // NOI18N
        btnNotformatted.setPreferredSize(new java.awt.Dimension(18, 23));
        btnNotformatted.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNotformatted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNotformattedActionPerformed(evt);
            }
        });
        editorToolBar.add(btnNotformatted);

        btnComment.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-Comment.png"))); // NOI18N
        btnComment.setFocusable(false);
        btnComment.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnComment.setMaximumSize(new java.awt.Dimension(18, 23));
        btnComment.setMinimumSize(new java.awt.Dimension(18, 23));
        btnComment.setName("btnComment"); // NOI18N
        btnComment.setPreferredSize(new java.awt.Dimension(18, 23));
        btnComment.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnComment.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCommentActionPerformed(evt);
            }
        });
        editorToolBar.add(btnComment);

        editorScrollPane.setName("editorScrollPane"); // NOI18N

        editorPane.setName("editorPane"); // NOI18N
        editorScrollPane.setViewportView(editorPane);

        nameTextField.setText(i18n.getValueForKey(I18N.key.windowNameBox));
        nameTextField.setName("nameTextField"); // NOI18N
        nameTextField.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                nameTextFieldFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                nameTextFieldFocusLost(evt);
            }
        });

        btnDiscard.setText(".discard");
        btnDiscard.setName("btnDiscard"); // NOI18N

        btnSave.setText(".save");
        btnSave.setName("btnSave"); // NOI18N
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        btnPreview.setFont(new java.awt.Font("Tahoma", 1, 11));
        btnPreview.setText(".preview");
        btnPreview.setName("btnPreview"); // NOI18N
        btnPreview.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPreviewActionPerformed(evt);
            }
        });

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/pencil.png"))); // NOI18N
        jLabel3.setText(".Version 0.0.2");
        jLabel3.setName("jLabel3"); // NOI18N

        omniTextField.setText(i18n.getValueForKey(I18N.key.windowOmniBox));
        omniTextField.setName("omniTextField"); // NOI18N
        omniTextField.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                omniTextFieldMouseClicked(evt);
            }
        });
        omniTextField.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                omniTextFieldFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                omniTextFieldFocusLost(evt);
            }
        });

        javax.swing.GroupLayout editorPanelLayout = new javax.swing.GroupLayout(editorPanel);
        editorPanel.setLayout(editorPanelLayout);
        editorPanelLayout.setHorizontalGroup(
            editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(editorToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
            .addGroup(editorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(editorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 637, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(editorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(nameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 637, Short.MAX_VALUE)
                    .addGroup(editorPanelLayout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 326, Short.MAX_VALUE)
                        .addComponent(btnPreview)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnDiscard)))
                .addContainerGap())
            .addGroup(editorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(omniTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 637, Short.MAX_VALUE)
                .addContainerGap())
        );
        editorPanelLayout.setVerticalGroup(
            editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(editorPanelLayout.createSequentialGroup()
                .addComponent(editorToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(editorScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(omniTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(editorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnDiscard)
                    .addComponent(btnSave)
                    .addComponent(btnPreview)
                    .addComponent(jLabel3))
                .addContainerGap())
        );

        contentTabbedPane.addTab(i18n.getValueForKey(I18N.key.tabsEditor), new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/editor.png")), editorPanel); // NOI18N

        settingsPanel.setName("settingsPanel"); // NOI18N

        tabbedPane.setTabPlacement(javax.swing.JTabbedPane.LEFT);
        tabbedPane.setName("tabbedPane"); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 534, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 449, Short.MAX_VALUE)
        );

        tabbedPane.addTab(I18N.getInstance().getValueForKey(I18N.key.settingsTab02), jPanel4);

        jPanel5.setName("jPanel5"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 534, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 449, Short.MAX_VALUE)
        );

        tabbedPane.addTab(I18N.getInstance().getValueForKey(I18N.key.settingsTab03), jPanel5);

        mainPanel1.setName("mainPanel1"); // NOI18N

        generalLAFPane.setBorder(javax.swing.BorderFactory.createTitledBorder(I18N.getInstance().getValueForKey(I18N.key.settingslafTitle)));
        generalLAFPane.setName("generalLAFPane"); // NOI18N

        lafComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Autumn", "Business", "Business Black", "Business Blue", "Challenger", "Cremme", "Cremme Coffe", "Dust", "Dust Coffe", "Emerald", "Legacy", "Magma", "Mist Aqua", "Mist Silver", "Moderate", "Nebula", "Nebula Brick", "Office Blue", "Office Silver", "Raven", "Raven Glass", "Raven Graphite", "Twilight" }));
        lafComboBox.setName("lafComboBox"); // NOI18N

        lafBtn.setText(I18N.getInstance().getValueForKey(I18N.key.stringApply));
        lafBtn.setName("lafBtn"); // NOI18N
        lafBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                lafBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout generalLAFPaneLayout = new javax.swing.GroupLayout(generalLAFPane);
        generalLAFPane.setLayout(generalLAFPaneLayout);
        generalLAFPaneLayout.setHorizontalGroup(
            generalLAFPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalLAFPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lafComboBox, 0, 0, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(lafBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        generalLAFPaneLayout.setVerticalGroup(
            generalLAFPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalLAFPaneLayout.createSequentialGroup()
                .addGroup(generalLAFPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lafComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lafBtn))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        generalLangsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(I18N.getInstance().getValueForKey(I18N.key.settingslangTitle)));
        generalLangsPanel.setName("generalLangsPanel"); // NOI18N

        langsComboBox.setMinimumSize(new java.awt.Dimension(95, 18));
        langsComboBox.setName("langsComboBox"); // NOI18N
        langsComboBox.setPreferredSize(new java.awt.Dimension(100, 20));

        langsBtn.setText(I18N.getInstance().getValueForKey(I18N.key.stringApply));
        langsBtn.setName("langsBtn"); // NOI18N
        langsBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                langsBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout generalLangsPanelLayout = new javax.swing.GroupLayout(generalLangsPanel);
        generalLangsPanel.setLayout(generalLangsPanelLayout);
        generalLangsPanelLayout.setHorizontalGroup(
            generalLangsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalLangsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(langsComboBox, 0, 0, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(langsBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        generalLangsPanelLayout.setVerticalGroup(
            generalLangsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(generalLangsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(generalLangsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(langsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(langsBtn))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout mainPanel1Layout = new javax.swing.GroupLayout(mainPanel1);
        mainPanel1.setLayout(mainPanel1Layout);
        mainPanel1Layout.setHorizontalGroup(
            mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(generalLangsPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(generalLAFPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        mainPanel1Layout.setVerticalGroup(
            mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(generalLAFPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(generalLangsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(296, Short.MAX_VALUE))
        );

        tabbedPane.addTab(I18N.getInstance().getValueForKey(I18N.key.settingsTab01), mainPanel1);

        javax.swing.GroupLayout settingsPanelLayout = new javax.swing.GroupLayout(settingsPanel);
        settingsPanel.setLayout(settingsPanelLayout);
        settingsPanelLayout.setHorizontalGroup(
            settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
        );
        settingsPanelLayout.setVerticalGroup(
            settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)
        );

        contentTabbedPane.addTab(i18n.getValueForKey(I18N.key.tabsSettings), new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/wrench.png")), settingsPanel); // NOI18N

        splitPane.setRightComponent(contentTabbedPane);

        javax.swing.GroupLayout contentPanelLayout = new javax.swing.GroupLayout(contentPanel);
        contentPanel.setLayout(contentPanelLayout);
        contentPanelLayout.setHorizontalGroup(
            contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 866, Short.MAX_VALUE)
        );
        contentPanelLayout.setVerticalGroup(
            contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
        );

        toolBar.setFloatable(false);
        toolBar.setRollover(true);
        toolBar.setMinimumSize(new java.awt.Dimension(0, 0));
        toolBar.setName("toolBar"); // NOI18N

        btnNewWiki.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/wikiNew.png"))); // NOI18N
        btnNewWiki.setFocusable(false);
        btnNewWiki.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNewWiki.setName("btnNewWiki"); // NOI18N
        btnNewWiki.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNewWiki.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNewWikiActionPerformed(evt);
            }
        });
        toolBar.add(btnNewWiki);

        btnOpenWiki.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/wikiOpen .png"))); // NOI18N
        btnOpenWiki.setFocusable(false);
        btnOpenWiki.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnOpenWiki.setName("btnOpenWiki"); // NOI18N
        btnOpenWiki.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnOpenWiki.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOpenWikiActionPerformed(evt);
            }
        });
        toolBar.add(btnOpenWiki);

        btnNewPage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-File.png"))); // NOI18N
        btnNewPage.setFocusable(false);
        btnNewPage.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNewPage.setName("btnNewPage"); // NOI18N
        btnNewPage.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(btnNewPage);

        btnAllPages.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-All.png"))); // NOI18N
        btnAllPages.setFocusable(false);
        btnAllPages.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnAllPages.setName("btnAllPages"); // NOI18N
        btnAllPages.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(btnAllPages);

        btnRandomPage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/wiscriptor/gui/resources/-Dice.png"))); // NOI18N
        btnRandomPage.setFocusable(false);
        btnRandomPage.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnRandomPage.setName("btnRandomPage"); // NOI18N
        btnRandomPage.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(btnRandomPage);

        jButton11.setText("jButton11");
        jButton11.setFocusable(false);
        jButton11.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton11.setName("jButton11"); // NOI18N
        jButton11.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton11);

        jButton10.setText("jButton10");
        jButton10.setFocusable(false);
        jButton10.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton10.setName("jButton10"); // NOI18N
        jButton10.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton10);

        jButton9.setText("jButton9");
        jButton9.setFocusable(false);
        jButton9.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton9.setName("jButton9"); // NOI18N
        jButton9.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton9);

        jButton8.setText("jButton8");
        jButton8.setFocusable(false);
        jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton8.setName("jButton8"); // NOI18N
        jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton8);

        jButton7.setText("jButton7");
        jButton7.setFocusable(false);
        jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton7.setName("jButton7"); // NOI18N
        jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton7);

        jButton6.setText("jButton6");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setName("jButton6"); // NOI18N
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        toolBar.add(jButton6);

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(toolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 866, Short.MAX_VALUE)
            .addComponent(contentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addComponent(toolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(contentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText("File");
        jMenu1.setName("jMenu1"); // NOI18N
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenu2.setName("jMenu2"); // NOI18N
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnCommentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCommentActionPerformed
        formatAction(OldLmlDocument.marks.comment, btnComment);
}//GEN-LAST:event_btnCommentActionPerformed

    private void btnNotformattedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNotformattedActionPerformed
        formatAction(OldLmlDocument.marks.not, btnNotformatted);
}//GEN-LAST:event_btnNotformattedActionPerformed

    private void btnSubscriptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubscriptActionPerformed
        formatAction(OldLmlDocument.marks.sub, btnSubscript);
}//GEN-LAST:event_btnSubscriptActionPerformed

    private void btnSuperscriptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSuperscriptActionPerformed
        formatAction(OldLmlDocument.marks.sup, btnSuperscript);
}//GEN-LAST:event_btnSuperscriptActionPerformed

    private void btnStrikeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStrikeActionPerformed
        formatAction(OldLmlDocument.marks.strike, btnStrike);
}//GEN-LAST:event_btnStrikeActionPerformed

    private void btnUnderlineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUnderlineActionPerformed
        formatAction(OldLmlDocument.marks.underline, btnUnderline);
}//GEN-LAST:event_btnUnderlineActionPerformed

    private void btnItalicActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnItalicActionPerformed
        formatAction(OldLmlDocument.marks.italic, btnItalic);
}//GEN-LAST:event_btnItalicActionPerformed

    private void btnBoldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBoldActionPerformed
        formatAction(OldLmlDocument.marks.bold, btnBold);
}//GEN-LAST:event_btnBoldActionPerformed

    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        editAction(null, WiscriptorController.editAction.delete);
}//GEN-LAST:event_btnDeleteActionPerformed

    private void btnPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPasteActionPerformed
        editAction(null, WiscriptorController.editAction.paste);
}//GEN-LAST:event_btnPasteActionPerformed

    private void btnCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCopyActionPerformed
        editAction(null, WiscriptorController.editAction.copy);
}//GEN-LAST:event_btnCopyActionPerformed

    private void btnCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCutActionPerformed
        editAction(null, WiscriptorController.editAction.cut);
}//GEN-LAST:event_btnCutActionPerformed

    private void contentTabbedPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_contentTabbedPaneStateChanged
        if (contentTabbedPane.getSelectedIndex() == 0) {
            // viewer
            viewerPane.setText(wiscontroller.editPage(editorPane.getText()));
        } else if (contentTabbedPane.getSelectedIndex() == 1) {
            // editor
            editorPane.setText(wiscontroller.getPageRawText());
        }
    }//GEN-LAST:event_contentTabbedPaneStateChanged

    private void viewerPaneHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {//GEN-FIRST:event_viewerPaneHyperlinkUpdate

        // TODO: pegar o tipo de evento e tomar iniciativas (se for url interna - abrir outra página, ou mostrar tags, etc)
        System.err.println(evt.getDescription() + " " + evt.getEventType() + " " + evt.getSourceElement() + " " + evt.getURL());
    }//GEN-LAST:event_viewerPaneHyperlinkUpdate

    private void btnNewWikiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewWikiActionPerformed
        String wikiName = (String) JOptionPane.showInputDialog(
                this,
                ".Wiki name:\n", // TODO: I18N
                ".Create Wiki",
                JOptionPane.PLAIN_MESSAGE,
                null,
                null,
                ".New Wiki");
        if (wikiName != null && !wikiName.equals("")) {
            wiscontroller.createWiki(wikiName);
        }
    }//GEN-LAST:event_btnNewWikiActionPerformed

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed

        // TODO: verificar a chamada ao criar / abrir arquivo - criar doc apropriadamente
        // TODO: verificar se mudou o titulo e criar novo doc
        // TODO: verificar retorno da função
        wiscontroller.savePage(nameTextField.getText(),
                editorPane.getText(),
                Category.getCategory(omniTextField.getText()),
                // TODO: pegar o restante da string, montar objeto tags (?) e inserir - certificar que categoria e valida
                "");

    }//GEN-LAST:event_btnSaveActionPerformed

    private void langsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_langsBtnActionPerformed
        Language l = langs.get(langsComboBox.getSelectedIndex());
        wiscontroller.changeLanguage(l.getLang(), l.getCountry());
}//GEN-LAST:event_langsBtnActionPerformed

    private void lafBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lafBtnActionPerformed
        wiscontroller.setLAF((String) lafComboBox.getSelectedItem());
        this.repaint();
}//GEN-LAST:event_lafBtnActionPerformed

    private void btnOpenWikiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenWikiActionPerformed
        String[] wikis = wiscontroller.getWikis();

        String wikiName = (String) JOptionPane.showInputDialog(
                this,
                ".Wikis", // TODO: I18N
                ".Open Wiki",
                JOptionPane.PLAIN_MESSAGE,
                null,
                wikis,
                null);
        if (wikiName != null && !wikiName.equals("")) {
            if (wiscontroller.openWiki(wikiName).equals(Utils.Status.SUCCESS)) {
                setCategoriesTree();
                setAppName();
            }
        }

    }//GEN-LAST:event_btnOpenWikiActionPerformed

    private void nameTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameTextFieldFocusGained
        if (nameTextField.getText().equals(i18n.getValueForKey(I18N.key.windowNameBox))) {
            nameTextField.setText("");
        }
    }//GEN-LAST:event_nameTextFieldFocusGained

    private void nameTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameTextFieldFocusLost
        if (nameTextField.getText().equals("")) {
            nameTextField.setText(i18n.getValueForKey(I18N.key.windowNameBox));
        }
    }//GEN-LAST:event_nameTextFieldFocusLost

    private void btnPreviewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPreviewActionPerformed
        contentTabbedPane.setSelectedComponent(viewerPanel);
    }//GEN-LAST:event_btnPreviewActionPerformed

    private void omniTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_omniTextFieldFocusGained
        if (omniTextField.getText().equals(i18n.getValueForKey(I18N.key.windowOmniBox))) {
            omniTextField.setText("");
        }
}//GEN-LAST:event_omniTextFieldFocusGained

    private void omniTextFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_omniTextFieldFocusLost
        if (omniTextField.getText().equals("")) {
            omniTextField.setText(i18n.getValueForKey(I18N.key.windowOmniBox));
        }
}//GEN-LAST:event_omniTextFieldFocusLost

    private void omniTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_omniTextFieldMouseClicked
        if (SwingUtilities.isRightMouseButton(evt)) {
            ArrayList<String> list = wiscontroller.getCategories();
            omniPopupMenu.removeAll();
            for (String s : list) {
                JMenuItem menu = new JMenuItem(s);
                menu.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent e) {
                        // TODO: append pegar somente a categoria, ou adicionar tags, selecao, etc
                        omniTextField.setText(((JMenuItem) e.getSource()).getText());
                    }
                });
                omniPopupMenu.add(menu);
            }
            omniPopupMenu.show(omniTextField, evt.getX(), evt.getY());
            omniTextField.grabFocus();
        }
    }//GEN-LAST:event_omniTextFieldMouseClicked

    private void catTreeValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_catTreeValueChanged
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) catTree.getLastSelectedPathComponent();
        if (node == null) {
            return;
        }
        Object nodeInfo = node.getUserObject();
        // show just leaves
        if (node.isLeaf()) {
            showPage(((String) nodeInfo));
        }

    }//GEN-LAST:event_catTreeValueChanged
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAllPages;
    private javax.swing.JToggleButton btnBold;
    private javax.swing.JToggleButton btnComment;
    private javax.swing.JButton btnCopy;
    private javax.swing.JButton btnCut;
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnDiscard;
    private javax.swing.JToggleButton btnItalic;
    private javax.swing.JButton btnNewPage;
    private javax.swing.JButton btnNewWiki;
    private javax.swing.JToggleButton btnNotformatted;
    private javax.swing.JButton btnOpenWiki;
    private javax.swing.JButton btnPaste;
    private javax.swing.JToggleButton btnPreformatted;
    private javax.swing.JButton btnPreview;
    private javax.swing.JButton btnRandomPage;
    private javax.swing.JButton btnRedo;
    private javax.swing.JButton btnSave;
    private javax.swing.JToggleButton btnStrike;
    private javax.swing.JToggleButton btnSubscript;
    private javax.swing.JToggleButton btnSuperscript;
    private javax.swing.JToggleButton btnUnderline;
    private javax.swing.JButton btnUndo;
    private javax.swing.JTree catTree;
    private javax.swing.JPanel contentPanel;
    private javax.swing.JTabbedPane contentTabbedPane;
    private javax.swing.JTextPane editorPane;
    private javax.swing.JPanel editorPanel;
    private javax.swing.JScrollPane editorScrollPane;
    private javax.swing.JToolBar editorToolBar;
    private javax.swing.JPanel generalLAFPane;
    private javax.swing.JPanel generalLangsPanel;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton lafBtn;
    private javax.swing.JComboBox lafComboBox;
    private javax.swing.JButton langsBtn;
    private javax.swing.JComboBox langsComboBox;
    private javax.swing.JPanel leftPanel;
    private javax.swing.JTabbedPane leftTabbedPane;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JPanel mainPanel1;
    private javax.swing.JTextField nameTextField;
    private javax.swing.JPopupMenu omniPopupMenu;
    private javax.swing.JTextField omniTextField;
    private javax.swing.JPanel settingsPanel;
    private javax.swing.JSplitPane splitPane;
    private javax.swing.JTabbedPane tabbedPane;
    private javax.swing.JToolBar toolBar;
    private javax.swing.JEditorPane viewerPane;
    private javax.swing.JPanel viewerPanel;
    private javax.swing.JScrollPane viewerScrollPane;
    // End of variables declaration//GEN-END:variables
}
